<?php

require_once(TANGRA_MAIN_DIR.'form/fields/text/form_field_text_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/email/form_field_email_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/textarea/form_field_textarea_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/checkbox/form_field_checkbox_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/integer_positive/form_field_integer_positive_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/guardable_form_view.class.php');


class rss_channel_Form_View extends Guardable_Form_View {
	function __construct(Form &$form) {
		parent::__construct($form);

		$f_title = $form->get_field('title');
		$f_title_view = new Form_Field_Textarea_View($form->get_name().'_'.$f_title->get_name(), $f_title);
		$this->add_field_view('title', $f_title_view);

		$f_link = $form->get_field('link');
		$f_link_view = new Form_Field_Text_View($form->get_name().'_'.$f_link->get_name(), $f_link);
		$this->add_field_view('link', $f_link_view);

		$f_description = $form->get_field('description');
		$f_description_view = new Form_Field_Textarea_View($form->get_name().'_'.$f_description->get_name(), $f_description);
		$this->add_field_view('description', $f_description_view);

		$f_language = $form->get_field('language');
		$f_language_view = new Form_Field_Text_View($form->get_name().'_'.$f_language->get_name(), $f_language);
		$this->add_field_view('language', $f_language_view);

		$f_copyright = $form->get_field('copyright');
		$f_copyright_view = new Form_Field_Text_View($form->get_name().'_'.$f_copyright->get_name(), $f_copyright);
		$this->add_field_view('copyright', $f_copyright_view);

		$f_managing_editor = $form->get_field('managing_editor');
		$f_managing_editor_view = new Form_Field_Email_View($form->get_name().'_'.$f_managing_editor->get_name(), $f_managing_editor);
		$this->add_field_view('managing_editor', $f_managing_editor_view);

		$f_web_master = $form->get_field('web_master');
		$f_web_master_view = new Form_Field_Email_View($form->get_name().'_'.$f_web_master->get_name(), $f_web_master);
		$this->add_field_view('web_master', $f_web_master_view);

		$f_ttl = $form->get_field('ttl');
		$f_ttl_view = new Form_Field_Integer_Positive_View($form->get_name().'_'.$f_ttl->get_name(), $f_ttl);
		$this->add_field_view('ttl', $f_ttl_view);
	}
}